

var FullScreenManager = (function(){
	function on(){
		var el = document.documentElement;
		var rfs = el.requestFullScreen || el.webkitRequestFullScreen ||
		    el.mozRequestFullScreen || el.msRequestFullScreen;
		if (rfs) { //typeof rfs != "undefined" && rfs
		    rfs.call(el);
		} else if (typeof window.ActiveXObject != "undefined") {
		    //for IEï¼è¿éå¶å®å°±æ¯æ¨¡æäºæä¸é®ççF11ï¼ä½¿æµè§å¨å¨å±
		    var wscript = new ActiveXObject("WScript.Shell");
		    if (wscript != null) {
		        wscript.SendKeys("{F11}");
		    }
		}
	}
	function off(){
	    var el = document;
	    var cfs = el.cancelFullScreen || el.webkitCancelFullScreen ||
	        el.mozCancelFullScreen || el.exitFullScreen;
	    if (cfs) { //typeof cfs != "undefined" && cfs
	        cfs.call(el);
	    } else if (typeof window.ActiveXObject != "undefined") {
	        //for IEï¼è¿éåfullScreenç¸åï¼æ¨¡ææä¸F11é®éåºå¨å±
	        var wscript = new ActiveXObject("WScript.Shell");
	        if (wscript != null) {
	            wscript.SendKeys("{F11}");
	        }
	    }
	}
	
	
	function click(){
		$(window).unbind();
		//å¨å±äºä»¶éè¦æå¨è§¦åï¼ç±äºæµè§å¨çå®å¨
		$("body").one('click',function(){
			on();
		});
		$("body").trigger("click");
	}
	
	return {on: on, off: off,click:click};
})();